home *** CD-ROM | disk | FTP | other *** search
/ Revista CD Expert 37 / CD Expert nº 37.iso / LastCall / lastcall.exe / stuff / lastcall.dxr / 00129_Hyperlinking.ls < prev    next >
Encoding:
Text File  |  2000-03-27  |  2.1 KB  |  65 lines

  1. property pSpr
  2.  
  3. on beginSprite me
  4.   pSpr = sprite(me.spriteNum)
  5.   pSpr.member.scrollTop = 0
  6.   pSpr.cursor = setCursor(pSpr, arrowCursor())
  7. end
  8.  
  9. on endSprite
  10.   setCursor(pSpr, defaultCursor())
  11. end
  12.  
  13. on HyperlinkClicked me, link
  14.   global gFileSep, gUserAnswer, gDemoVersion
  15.   myBrowser = browserName()
  16.   oldDelimiter = the itemDelimiter
  17.   the itemDelimiter = gFileSep
  18.   if link starts "file" then
  19.     promptText = "Would you like to open your web browser to read the detailed help file?  If your browser doesn't launch automatically, exit the game and check the Help folder for "
  20.     if gDemoVersion then
  21.       put "the help files in HTML format." after myBrowser
  22.     else
  23.       put "documents in various formats." after myBrowser
  24.     end if
  25.     titleText = "Open Help?"
  26.     rootTemp = the moviePath
  27.     delete char -30000 of rootTemp
  28.     delete char -30002 of rootTemp
  29.     root = EMPTY
  30.     repeat with X = 1 to length(rootTemp)
  31.       if rootTemp.char[X] = SPACE then
  32.         put "%20" after myBrowser
  33.         next repeat
  34.       end if
  35.       if rootTemp.char[X] = gFileSep then
  36.         put "/" after myBrowser
  37.         next repeat
  38.       end if
  39.       put rootTemp.char[X] after myBrowser
  40.     end repeat
  41.     web = "file:///" & root & "/help/index.htm"
  42.   else
  43.     if link starts "mailto:" then
  44.       web = link
  45.       len = length("mailto:")
  46.       mail = web.char[len + 1..length(web)]
  47.       promptText = "Is your browser set up to send email? If not, open your email program manually and send us mail at" && mail
  48.       titleText = "Go Online?"
  49.     else
  50.       web = link
  51.       promptText = "Would you like to open your web browser and go online? If your browser doesn't open automatically, start it manually and visit" && web
  52.       titleText = "Go Online?"
  53.     end if
  54.   end if
  55.   multiButtonDialog(["Yes", "No"], [#MAC: [100, 275], #Win: [75, 225]], "No", titleText, promptText, [#MAC: 425, #Win: 300], [#MAC: 75, #Win: 50])
  56.   if gUserAnswer = "Yes" then
  57.     if myBrowser <> EMPTY then
  58.       gotoNetPage(web)
  59.     else
  60.       MUIalert("You don't seem to have a browser installed. If you do, start it manually and open" && web)
  61.     end if
  62.   end if
  63.   the itemDelimiter = oldDelimiter
  64. end
  65.